package com.supreme.consumerserver.kafka;

import com.supreme.common.constant.ConsoleColors;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class KafkaConsumer {

    @KafkaListener(topics = {"SUPREME_MYSQL_TOPIC"}, groupId = "supreme-group")
    public void onMessage(ConsumerRecord<String, String> record) {
        ConsoleColors.printf(ConsoleColors.YELLOW_BOLD_BRIGHT, "KafkaConsumer record = %s partition = %s value = %s\n", record.topic(), record.partition(), record.value());
    }
}
